const workspaceBox = box.copy();
const [width, height] = workspaceBox.get_size();
const { spacing } = this;
+ const { expandFraction } = this._workspacesThumbnails;
switch (state) {
case ControlsState.HIDDEN:
case ControlsState.WINDOW_PICKER:
workspaceBox.set_origin(0,
searchHeight + spacing +
- (thumbnailsHeight > 0 ? thumbnailsHeight + spacing : 0));
+ thumbnailsHeight + spacing * expandFraction);
workspaceBox.set_size(width,
height -
dashHeight - spacing -
searchHeight - spacing -
- (thumbnailsHeight > 0 ? thumbnailsHeight + spacing : 0));
+ thumbnailsHeight - spacing * expandFraction);
break;
case ControlsState.APP_GRID:
workspaceBox.set_origin(0, searchHeight + spacing);
// Workspace Thumbnails
let thumbnailsHeight = 0;
if (this._workspacesThumbnails.visible) {
+ const { expandFraction } = this._workspacesThumbnails;
[thumbnailsHeight] =
this._workspacesThumbnails.get_preferred_height(width);
thumbnailsHeight = Math.min(
- thumbnailsHeight,
+ thumbnailsHeight * expandFraction,
height * WorkspaceThumbnail.MAX_THUMBNAIL_SCALE);
childBox.set_origin(0, searchHeight + spacing);
childBox.set_size(width, thumbnailsHeight);
this._thumbnailsBox =
new WorkspaceThumbnail.ThumbnailsBox(this._workspaceAdjustment);
- this._thumbnailsBox.connect('notify::should-show',
- () => this._updateThumbnailsBox());
+ this._thumbnailsBox.connect('notify::should-show', () => {
+ this._thumbnailsBox.show();
+ this._thumbnailsBox.ease_property('expand-fraction',
+ this._thumbnailsBox.should_show ? 1 : 0, {
+ duration: SIDE_CONTROLS_ANIMATION_TIME,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onComplete: () => this._updateThumbnailsBox(),
+ });
+ });
this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay(
this,
var ThumbnailsBox = GObject.registerClass({
Properties: {
+ 'expand-fraction': GObject.ParamSpec.double(
+ 'expand-fraction', 'expand-fraction', 'expand-fraction',
+ GObject.ParamFlags.READWRITE,
+ 0, 1, 1),
'scale': GObject.ParamSpec.double(
'scale', 'scale', 'scale',
GObject.ParamFlags.READWRITE,
this._targetScale = 0;
this._scale = 0;
+ this._expandFraction = 1;
this._pendingScaleUpdate = false;
this._stateUpdateQueued = false;
this._animatingIndicator = false;
}
const ratio = portholeWidth / portholeHeight;
- const thumbnailHeight = Math.round(portholeHeight * this._scale);
- const thumbnailWidth = Math.round(thumbnailHeight * ratio);
+ const thumbnailFullHeight = Math.round(portholeHeight * this._scale);
+ const thumbnailWidth = Math.round(thumbnailFullHeight * ratio);
+ const thumbnailHeight = thumbnailFullHeight * this._expandFraction;
const roundedVScale = thumbnailHeight / portholeHeight;
// We always request size for MAX_THUMBNAIL_SCALE, distribute
get shouldShow() {
return this._shouldShow;
}
+
+ set expandFraction(expandFraction) {
+ if (this._expandFraction === expandFraction)
+ return;
+ this._expandFraction = expandFraction;
+ this.notify('expand-fraction');
+ this.queue_relayout();
+ }
+
+ get expandFraction() {
+ return this._expandFraction;
+ }
});